// Problem 3: Largest prime factor
// What is the largest prime factor of the number 600851475143 ?

package main

import (
	"fmt"
)

func p003() int {
	n, r := 600851475143, 6
	for i := 6; i <= n+1; i += 6 {
		if x := i - 1; n%x == 0 {
			n, r = n/x, x
		}
		if x := i + 1; n%x == 0 {
			n, r = n/x, x
		}
	}
	fmt.Println("Problem 003:", r)
	return r
}
